<?php
require_once 'Zend/Session/Namespace.php';
class UserTuanController extends Zend_Controller_Action {
	
	public function init() {
		$this->smarty = Zend_Registry::get ( 'smarty' );
		$this->config = Zend_Registry::get ( 'config' );
		$this->smarty->assign ( 'baseUrl', $this->_request->getBaseUrl () );
	
	}
    public function indexAction() {
		
    	$db=Zend_Registry::get('db');
    	$sql="select   stus.site , stus.initSite , stp.id, stp.title , stp.url , stp.shopUrl ,stp.detail , stp.cityName , stp.imageUrl , stp.value , stp.price   
            , stp.reBate ,  TIMESTAMPDIFF(second,sysdate(),stp.endTime  ) as lastTime, stp.bought
            from  shop_tuan_product stp LEFT join shop_tuan_user_shop stus
            on stp.shopId=stus.shopId   where 1=1";
    	$result = $db->query ( $sql );
    	$rows = $result->fetchAll ();  
    	echo count($rows) ;
    	
    	
    	
    	
    	
    	
    	
    
    	
    	
    	
		$this->smarty->assign ( 'title', 'default' );
		$this->smarty->display ( 'user/userTuan.phtml' );
	}
	

}